package com.zzw.String;

/**
 * Created by Administrator on 2017/7/7.
 */
public class InternTest {

    public static void main(String[] args) {
        String s1 = new String("hello");

        String s2 = "hello";
        System.out.println(s1 == s2);

        /*String s1 = new String("计算机");
        String s2 = s1.intern();
        String s3 = "计算机";
        System.out.println(s1 == s2);
        System.out.println(s3 == s2);

        String hello = "hello";
        String temp = "hello";
        System.out.println(hello == temp);
        String lo = "lo";
        System.out.println((hello == "hello") + "");
        System.out.println(Other.hello == "hello");
        System.out.println(Other.hello == hello);*/
    }

}
class Other{
    static String hello = "hello";
}
